package com.sinodata.bsm.center.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.sinodata.bsm.center.dao.BsmDao;

@Repository
public class BsmDaoImpl implements BsmDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public List queryTables() throws Exception {
        List result = jdbcTemplate.queryForList("select t.table_name, t.status,t.num_rows,t.table_lock,t.backed_up,t.user_stats,t.dependencies,t.compression from user_tables t");
        return result;
    }

    @Override
    public List queryProcedure() throws Exception {
        return jdbcTemplate.queryForList("select * from user_objects where object_type='PROCEDURE'");
    }

    @Override
    public List queryJobs() throws Exception {
        return jdbcTemplate.queryForList("select * from user_jobs");
    }

}
